home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
haeberli
/
tools
/
rgntest.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-01
|
2KB
|
74 lines
/*
* Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
/*
* rgntest -
*
* An rgn example. This program demonstrates an implementation
* of the functionality contained in ../libgutil/rgn.c. This
* library provides support for management of regions. A region
* can be thought of as an area described by a list of rectangles.
*
* Paul Haeberli - 1991
*/
#include "gl.h"
#include "device.h"
#include "rct.h"
#include "rgn.h"
main()
{
rgn *r1, *r2, *r3;
int i;
winopen("rgntest");
color(7);
clear();
color(0);
r1 = rgnnew();
r2 = rgnnew();
r3 = rgnnew();
rgnsetrect(r1,10,10,100,100);
rgnsetrect(r2,50,50,150,150);
color(1);
rgndraw(r1);
rgndraw(r2);
sleep(1);
rgnunion(r1,r2,r3);
color(2);
rgnfill(r3);
sleep(1);
for(i=0; i<5; i++) {
rgnshrink(r3,6,6);
color(3+i);
rgnfill(r3);
sginap(20);
}
for(i=0; i<5; i++) {
rgnshadow(r3,6,6);
color(30+i);
rgnfill(r3);
sginap(20);
}
sleep(1000);
}